package com.quantice.Manager;

import com.quantice.Constants.StrConst;
import com.quantice.mainActivity.R;

import android.app.AlertDialog;
import android.content.Context;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class AddDialogManager extends AlertDialog.Builder {
	Context context;
	View addView;

	public AddDialogManager(Context context, int currentTab, View view) {
		super(context);
		this.context = context;
		this.addView = view;
		if (currentTab == 0) {
			this.setTitle(StrConst.add_tit_gasto);
		} else {
			this.setTitle(StrConst.add_tit_ingreso);
		}
		this.setView(view);
	}

	public void addRepeatSpinner() {
		Spinner spinner = (Spinner) addView.findViewById(R.id.repeatlist);
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
				context, R.array.repeatlist_array,
				android.R.layout.simple_spinner_item);
		// Specify the layout to use when the list of choices appears
		adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
		// Apply the adapter to the spinner
		spinner.setAdapter(adapter);
	}

}
